package yangcheng.first;

import java.util.Scanner;

public class GeometricMain {
    public static void main(String[] args) {
        Circle circle = new Circle();
        Rectangle rectangle = new Rectangle();
        GeometricObject geometricObject = new GeometricObject();
        Scanner sc=new Scanner(System.in);


        System.out.print("请输入圆的半径: ");
        double radius=sc.nextDouble();
        circle.setRadius(radius);
        System.out.printf("圆的面积是: %.2f  圆的周长是: %.2f\n",circle.getArea(),circle.getPerimeter());

        System.out.print("请输入长方形的长与宽: ");
        double h =sc.nextDouble();
        double w =sc.nextDouble();
        rectangle.setWidth(w);
        rectangle.setHeight(h);
        System.out.printf("长方形的面积是: %.2f\n",rectangle.getArea());

        System.out.println("颜色为"+geometricObject.getColor());
        System.out.print("设置新颜色为");
        String A = sc.nextLine();
        geometricObject.setColor(A);
        //System.out.println("新颜色为"+geometricObject.getColor());

        System.out.println("filled为"+geometricObject.isFilled());
        System.out.print("设置新filled为(T or F)");
        Boolean  filled = sc.nextBoolean();
        geometricObject.setFilled(filled);
        System.out.println("新filled为"+geometricObject.isFilled());
    }
}
